package com.xiaoyao.myframeapp.core;


import com.xiaoyao.myframeapp.MvpTest.bean.Test;

import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;


/**
 * @author Administrator
 * @Author xiaoyao
 * @Email xiao80206040@qq.com
 * @Explain 定义Retrofit访问的接口
 * @date 2018/7/3 0003
 */
public interface RetrofitService {
    @FormUrlEncoded
    @POST("s_user/Login")
    Observable<BaseEntity<Test>> login(
            @Field("myId") String userId,
            @Field("pwd") String password
    );

//    @GET("s_user/Login")
    @GET("/im/test/Login")
    Observable<BaseEntity<Test>> getVideoUrl();

    @FormUrlEncoded
    @POST("user/addVideo")
    Observable<BaseEntity<Boolean>> addVideo(
            @FieldMap Map<String, Object> map
    );

    //TODO 上传用户经纬度
    @FormUrlEncoded
    @POST("user/uploadLatLon")
    Observable<BaseEntity<Boolean>> uploadLatLon(
            @Field("longitude") String longitude,
            @Field("latitude") String latitude,
            @Field("userId") String userId,
//            @Field("registrationId") String registrationId, //TODO 消息推送设备标识
            @Field("deviceType") String deviceType //TODO 手机型号。1：iOS，2：Android
    );

}
